package com.neutech.runtime;

import com.neutech.base.Constant;
import com.neutech.base.Sprite;
import com.neutech.util.ImageUtil;

import java.awt.*;

public class Land extends Sprite {

    private Image image;

    public Land(){
        init();
    }

    private void init() {
        image = ImageUtil.get("land");
        setX(0);
        setY(Constant.WINDOW_HEIGHT-image.getHeight(null));
        setHeight(image.getHeight(null));
    }

    @Override
    public void draw(Graphics g) {

        g.drawImage(image,getX(),getY(),null);
    }
    @Override
    public void move(){
        setX(getX()-2);
        if (getX()<=Constant.WINDOW_WIDTH-image.getWidth(null));
        setX(0);
    }
}
